/**
 * @file startserverdialog.cpp
 * @brief StartServerDialog class implementation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 3 of the License.
 *
 * @author VestniK (Sergey N.Vidyuk) sir.vestnik@gmail.com
 * @date 1 May 2010
 */
#include "startserverdialog.h"

#include <QtCore/QSettings>

#include "defaults.h"

using namespace mjn;

StartServerDialog::StartServerDialog(QWidget *parent): QDialog(parent) {
    setupUi(this);
    QSettings settings;
    quint16 port = settings.value("port",DEFAULT_PORT).value<quint16>();
    portEdit->setValue( port );
}

quint16 StartServerDialog::port() const {
    if ( changePortCheckBox->checkState() == Qt::Unchecked ) {
        QSettings settings;
        return settings.value("port",DEFAULT_PORT).value<quint16>();
    }
    return portEdit->value();
}
